package com.shekhar.paas.vo;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import com.shekhar.paas.search.PaasProvider;

public class PaasCountInfo {

    private final PaasProvider paasProvider;

    private final long count;

    private long normalizedCount;

    public PaasCountInfo(PaasProvider paasProvider, long count) {
        this.paasProvider = paasProvider;
        this.count = count;
    }

    public PaasCountInfo(PaasCountInfo paasCountInfo, long normalizedCount) {
        this.paasProvider = paasCountInfo.getPaasProvider();
        this.count = paasCountInfo.getCount();
        this.normalizedCount = normalizedCount;
    }

    public PaasProvider getPaasProvider() {
        return paasProvider;
    }

    public long getCount() {
        return count;
    }
    
    public long getNormalizedCount() {
        return normalizedCount;
    }

    public boolean equals(Object obj) {
        if (!(obj instanceof PaasCountInfo)) {
            return false;
        }
        if (this == obj) {
            return true;
        }
        PaasCountInfo rhs = (PaasCountInfo) obj;
        return new EqualsBuilder().append(count, rhs.count).append(paasProvider, rhs.paasProvider).isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder().append(count).append(paasProvider).toHashCode();
    }

    @Override
    public String toString() {
        return "PaasCountInfo [paasName=" + paasProvider + ", count=" + count + "]";
    }

}
